<template>
  <div class="footer">
    <div class="horizontal">
      <div class="footer-item">
        <text style='font-family:iconfont;font-size:50;color:red'>&#xe8a0;</text>
        <text class="font">主页</text>
      </div>
      <div class="footer-item">
        <text style='font-family:iconfont;font-size:50;'>&#xe86e;</text>
        <text class="font">投资</text>
      </div>
      <div class="footer-item" @click="jumpAccount">
        <text style='font-family:iconfont;font-size:50;'>&#xe86d;</text>
        <text class="font">账户</text>
      </div>
    </div>
  </div>
</template>
<script>
const storage = weex.requireModule('storage')
module.exports = {
  data: function(){
  	return {}
	},
  created:function(){
  },
  mounted: function() {
    var domModule = weex.requireModule('dom');
    //目前支持ttf、woff文件，不支持svg、eot类型,moreItem at http://www.iconfont.cn/
     domModule.addRule('fontFace', {
        'fontFamily': "iconfont",
        'src': "url('http://at.alicdn.com/t/font_j0q7igs8xna5rk9.ttf')"
      });
  },
  methods:{
    jumpAccount:function(){
      storage.getItem('userInfo', event => {
        if(event.data !== "undefined"){
          this.jump('/account')
        }else{
          this.jump('/login')
        }
      })
    }
  }
}
</script>
<style>
.horizontal{
  flex-direction:row;
}
/*footer 底部栏*/
.footer{
  bottom: 0px;
  position: fixed;
  width: 750px;
}
.footer-item{
  flex:1;
  align-items:center;
  height: 120px;
  flex-direction:column;
  justify-content: center;
  align-items:center;
  border-width:1;
}

</style>